﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ServerFrame
{
    /// <summary>
    /// 消息编码器
    /// </summary>
    /// <param name="value"></param>
    /// <returns></returns>
    public delegate byte[] MessageEncode(object value);

    /// <summary>
    /// 消息解码器
    /// </summary>
    /// <param name="value"></param>
    /// <returns></returns>
    public delegate object MessageDecode(byte[] value);

    /// <summary>
    /// 消息长度编码器
    /// </summary>
    /// <param name="buff"></param>
    /// <returns></returns>
    public delegate byte[] LengthEncode(byte[] buff);

    /// <summary>
    /// 消息长度解码器
    /// </summary>
    /// <param name="buff"></param>
    /// <returns></returns>
    public delegate byte[] LengthDecode(ref List<byte> buff);

    /// <summary>
    /// 消息加密器
    /// </summary>
    /// <param name="buff"></param>
    /// <returns></returns>
    public delegate byte[] MessageEncrypt(byte[] buff);

    /// <summary>
    /// 消息解密器
    /// </summary>
    /// <param name="buff"></param>
    /// <returns></returns>
    public delegate byte[] MessageDecrypt(byte[] buff);

    /// <summary>
    /// 消息压缩器
    /// </summary>
    /// <param name="buff"></param>
    /// <param name="progress"></param>
    /// <returns></returns>
    public delegate byte[] CompressEncode(byte[] buff, SevenZip.ICodeProgress progress = null);

    /// <summary>
    /// 消息解压器
    /// </summary>
    /// <param name="buff"></param>
    /// <param name="progress"></param>
    /// <returns></returns>
    public delegate byte[] CompressDecode(byte[] buff, SevenZip.ICodeProgress progress = null);

}
